<%@ page contentType="text/html; charset=UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%@ include file="/app/include.jsp"%>
		<script type="text/javascript">
			// 添加字典集信息
			function add(){
				var fromUrl = "${pageContext.request.contextPath}/app/module/dict/insert-one-dictdata.jsp?codetype="+$("#codetype").val();
				var toUrl = "${pageContext.request.contextPath}/auth/dict/addOneDictData.do";
				var title = "添加字典集内容";
				Tool.showSaveDialog(fromUrl,toUrl,title,500,200);
			}
			
			// 修改字典集信息
			function edit(codeytpe,codevalue){
				var fromUrl = "${pageContext.request.contextPath}/auth/dict/selectOneDictData.do?codetype=" + codeytpe+"&codevalue="+codevalue;
				var toUrl = "${pageContext.request.contextPath}/auth/dict/editOneDictData.do";
				var title = "修改字典集内容";
				Tool.showUpdateDialog(fromUrl,toUrl,title,500,200);
			}
			
			// 删除字典集信息
			function del(codetype,codevalue){
				var url = "${pageContext.request.contextPath}/auth/dict/delOneDictData.do";
				var params = {
					"codetype" : codetype,
					"codevalue" : codevalue
				};
				Tool.del(url,params);
			}
			
		</script>
	</head>
	<body>
		<div class="right_content">
			<div class="pull">
				<form id="queryForm" name="queryForm" action="${pageContext.request.contextPath}/auth/dict/loadDictDataList.do">
					<div class="pull-left">
						字典内容&nbsp;<input name="codevalue" type="text" style="width: 240px;" value="${codevalue}"/>
						<input id="codetype" name="codetype" type="hidden" value="${param.codetype }"/>
					</div>
					<div class="pull-right">
						<input type="button" class="btn btn-primary" value="查询" onclick="Page.queryPage();"/>
						<input type="button" class="btn btn-primary" value="重置" onclick="Page.clearForm();"/>
						<input type="button" class="btn btn-primary" value="增加字典集内容" onclick="add();"/>
					</div>
				</form>
			</div>
			<div class="table-wrap">
				<table border="0" cellpadding="0" cellspacing="0" class="list">
					<thead>
						<tr>
							<th width="8%">序号</th>
							<th width="10%">字典名称</th>
							<th width="12%">字典值</th>
							<th width="10%">字典内容</th>
							<th width="10%">语言类型</th>
							<th width="15%">启用时间</th>
							<th width="15%">停用时间</th>
							<th width="20%">操作</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="result" items="${page.list}" varStatus="status">
						<tr>
							<td>${status.index + 1 }</td>
							<td>${result.id.codetype }</td>
							<td>${result.id.codevalue }</td>
							<td>${result.codename }</td>
							<td>${result.locale }</td>
							<td>${open:format(result.startdate,"yyyy-MM-dd")}</td>
							<td>${open:format(result.stopdate,"yyyy-MM-dd")}</td>
							<td>
								<a href="javascript:void(0);" onclick="edit('${result.id.codetype }','${result.id.codevalue }');">修改</a>&nbsp;
								<a href="javascript:void(0);" onclick="del('${result.id.codetype }','${result.id.codevalue }');">删除</a>
							</td>
						</tr>
						</c:forEach>
						<c:if test="${fn:length(page.list) == 0}">
							<tr>
								<td colspan=8 align="center"><font color=red><strong>字典内容为空或者没有满足条件的字典内容！</strong></font></td>
							</tr>
						</c:if>
					</tbody>
				</table>
			</div>
			<!--分页开始-->
			${page.operate }
			<!--/分页结束-->
		</div>
	</body>
</html>